package com.baitiaojun.moments.feign;

import com.baitiaojun.api.exception.ConditionException;
import com.baitiaojun.api.vo.JsonRes;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @类名 VideoFeign
 * @描述 TODO
 * @作者 白条君
 * @创建日期 2023/1/13 00:27
 * @版本 1.0
 */
@FeignClient(name = "imooc-bilibili-video", path = "/video")
public interface VideoFeign {

    @GetMapping("/video-details")
    JsonRes getVideoDetails(@RequestParam("videoId") Long videoId) throws Exception;

    @GetMapping("/video-view")
    JsonRes getVideoViewCount(@RequestParam("videoId") Long videoId);

    @GetMapping("/comment/video-comment-count")
    Integer getVideoCommentCount(@RequestParam("videoId") Long videoId);

    @GetMapping("/video-like")
    JsonRes getVideoLike(@RequestParam("videoId") Long videoId) throws Exception;

    @GetMapping("/search-video-ids")
    List<Long> getVideoIds();

    @DeleteMapping("/cancel-video")
    void removeVideo(@RequestParam("videoId") Long videoId) throws ConditionException;
}